export function getImei() {
	const user = uni.getStorageSync('user')
	const imei = uni.getStorageSync(user.userId)
	return imei;
}

export function getUserInfo(){
		const user = uni.getStorageSync('user')
		return user;
}
export function getUserAccount(){
	const user = uni.getStorageSync('user')
	return user.userAcc;
}

export function getUserHeaderImage(){
	const user = uni.getStorageSync('user')
	return user.headUrl;
}

export function removeCurrentImei(){
	const user = uni.getStorageSync('user')
	uni.removeStorageSync(user.userId)
}

export function getUserId() {
	const user = uni.getStorageSync('user')
	return user.userId;
}

export function getToken(){
	return uni.getStorageSync("token")
}

export function  hasDevice(){
	return uni.getStorageSync("hasDevice")
}

export function logoutClearStorage() {
	uni.removeStorageSync('user');
	uni.removeStorageSync('token');
	uni.removeStorageSync('gesturePwd');
	uni.removeStorageSync('fingerprint');
	uni.removeStorageSync("hasDevice");
}

export function trackPlayStyle() {
	const style = uni.getStorageSync(getImei());
	if(style){
		return style
	}else{
		return 1
	}
}

export function getStyle(style) {
	if (style == 1) {
		return "线"
	} else if (style == 2) {
		return "点"
	} else {
		return "线"
	}
}

//查找手势密码
export function getGesturePwd(){
	return uni.getStorageSync('gesturePwd')
}
//清除手势密码
export function clearGesturePwd(){
	uni.removeStorageSync('gesturePwd')
}
//存储手势密码 
export function saveGesturePwd(gesturePwd){
	uni.setStorageSync('gesturePwd',JSON.stringify(gesturePwd));
}

//获取是否开启手势密码
export function gesturePwdState(){
	return uni.getStorageSync("gesturePwdState");
}

//保存关闭手势密码
export function openGesturePwd(state){
	uni.setStorageSync('gesturePwdState',state);
}

//开启指纹
export function setFingerprintState(state){
	uni.setStorageSync('fingerprint',state);
}

//获取指纹开启关闭状态
export function getFingerPrintState(state){
	return uni.getStorageSync("fingerprint");
}